{include file="public/head"}
<div class="main">
    {include file="public/left"}
    <div class="middle">
    {include file="public/header"}
    <div class="task_detail">
        <ul class="task_info">
            <dl>
                <div><span id="title"><i class="fa fa-calendar" aria-hidden="true"></i></span></div>
                <div><h6>{:__('任务价格')}：$<span class="task_money"></span></h6></div>
                <div><h6>{:__('任务编号')}：</h6><span id="mission_no"></span></div>
                <div><h6>{:__('开始时间')}：</h6><span id="create_time"></span></div>
                <div><h6>{:__('结束时间')}：</h6><span class="end_time"></span></div>
                <div><h6>{:__('剩余时间')}：</h6><span id="left_time"></span></div>
                <div><h6>{:__('任务状态')}：</h6><span class="task_status" id="status"></span></div>   
            </dl>
            <dl>
                <div class="task_btn_3">
                    <button id="sign_task" style="display: none;margin-bottom: 10px;" class="layui-btn layui-btn-primary"></button>
                    <button id="send_task" style="display: none;" class="layui-btn layui-btn-primary"></button>
                    <button id="comment_task" style="display: none;" class="layui-btn layui-btn-primary">{:__('任务评论')}</button>
                </div>
                <div class="task_btn_12" style="display: none;">
                    <button class="layui-btn layui-btn-primary" id="complete">{:__('确认任务完成')}</button>
                </div>
            </dl>
            <dl class="task_detail_tip task_detail_tip_hidden">
                <div class="money_cfg_1">
                    <h6><i class="fa fa-star" aria-hidden="true"></i>{:__('中标模式（写手抄袭一律封号处理）')}</h6>
                    <span>{:__('中标模式，任务需要 1个稿件,中标稿件获得')}$ {:__('赏金')}。{:__('建议投文字稿，上传附件可能无法查看')}。{:__('当前共')}{:__('份投稿')}， {:__('已中标')} {:__('个稿件')} 。</span>
                </div>
                <div class="money_cfg_1">
                    <h6><i class="fa fa-get-pocket" aria-hidden="true"></i>{:__('赏金声明（雇主失信将被全站曝光）')}</h6>
                    <span>{:__('写手必须是登录状态下才能参与投稿，时间结束则无法投稿，稿件如果被客户选中，稿费分配如下：任务悬赏金额为')}$。{:__('如雇主小号作弊/写手抄袭属实将被严厉处罚')}。</span>         
                </div>
                <div>
                    <h6><i class="fa fa-get-pocket" aria-hidden="true"></i>{:__('状态声明')}</h6>
                    <span>{:__('任务投稿中！个人可以进行投稿，投稿截止时间')}。{:__('雇主可以进行选稿')}!</span>
                </div>
            </dl>
            <dl class="task_detail_tip" style="display: none;">
                
                <div class="money_cfg_1">
                    <h6><i class="fa fa-star" aria-hidden="true"></i>{:__('中标模式（写手抄袭一律封号处理）')}</h6>
                    <span>{:__('单人中标模式，任务需要 1个稿件,中标稿件获得')}$<span class="task_money"></span> {:__('赏金')}。{:__('建议投文字稿，上传附件可能无法查看')}。{:__('当前共')}<span class="contribute_all"></span>{:__('份投稿')}， {:__('已中标')}<span class="contribute_win"></span> {:__('个稿件')} 。</span>
                </div>
                <div class="money_cfg_1">
                    <h6><i class="fa fa-get-pocket" aria-hidden="true"></i>{:__('赏金声明（雇主失信将被全站曝光）')}</h6>
                    <span>{:__('写手必须是登录状态下才能参与投稿，时间结束则无法投稿，稿件如果被客户选中，稿费分配如下：任务悬赏金额为')}$<span class="task_money"></span>。{:__('如雇主小号作弊/写手抄袭属实将被严厉处罚')}。</span>         
                </div>
               
                <div class="money_cfg_2">
                    <h6><i class="fa fa-star" aria-hidden="true"></i>{:__('中标模式（写手抄袭一律封号处理）')}</h6>
                    <span>{:__('多人中标模式，全部奖项选完后开启付款')}
                        <span class="task_1">{:__('一等奖')}&nbsp;<span id="txt_pople_1"></span>&nbsp;{:__('人,每个人奖金')} $<span id="txt_avg_money_1"></span>,</span>
                        <span class="task_2">{:__('二等奖')}<span id="txt_pople_2"></span>{:__('人,每个人奖金')} $<span id="txt_avg_money_2"></span>,</span>
                        <span class="task_3">{:__('三等奖')}<span id="txt_pople_3"></span>{:__('人,每个人奖金')} $<span id="txt_avg_money_3"></span>,</span>
                        {:__('当前共')}<span class="contribute_all"></span>{:__('份投稿')}，{:__('已中标')} <span class="contribute_win"></span> {:__('个稿件')} 。</span>
                </div>
                <div class="money_cfg_2">
                    <h6><i class="fa fa-get-pocket" aria-hidden="true"></i>{:__('赏金声明（雇主失信将被全站曝光）')}</h6>
                    <span>{:__('写手必须是登录状态下才能参与投稿，时间结束则无法投稿，稿件如果被客户选中，稿费分配如下：多人中标模式，依据雇主奖项设置规则颁发奖金。建议投文字稿，上传附件可能无法查看。')}</span>         
                </div>
                
                <div class="money_cfg_3">
                    <h6><i class="fa fa-star" aria-hidden="true"></i>{:__('中标模式（写手抄袭一律封号处理）')}</h6>
                    <span>{:__('计件中标模式，合格一个结算一个稿费（秒到账）任务需要')}<span class="gj_num"></span>{:__('个稿件')}，{:__('每件中标稿设置')}$<span class="gj_money"></span>{:__('赏金')}。{:__('建议投文字稿，上传附件可能无法查看。当前共')}<span class="contribute_all"></span>{:__('份投稿')}， {:__('已中标')} <span class="contribute_win"></span> {:__('个稿件')} 。</span>
                </div>
                <div class="money_cfg_3">
                    <h6><i class="fa fa-get-pocket" aria-hidden="true"></i>{:__('赏金声明（雇主失信将被全站曝光）')}</h6>
                    <span>{:__('写手必须是登录状态下才能参与投稿，时间结束则无法投稿，稿件如果被客户选中，稿费分配如下：任务需要')} <span class="gj_num"></span>{:__('个稿件')}，{:__('每件中标稿件获得')}$<span class="gj_money"></span> {:__('赏金')}。{:__('如雇主小号作弊/写手抄袭属实将被严厉处罚')}。</span>         
                </div>
              
                <div>
                    <h6><i class="fa fa-get-pocket" aria-hidden="true"></i>{:__('状态声明')}</h6>
                    <span>{:__('任务投稿中！个人可以进行投稿，投稿截止时间')}<span class="end_time"></span>。{:__('雇主可以进行选稿')}!</span>
                </div>
                
            </dl>
        </ul>
        <ul class="task_userinfo">
            <dl>
                <h6>{:__('任务发布者')}</h6>
                <div>
                    <img id="avatar" src="{$osslink}static/index/image/index/avgdefaultsmall.jpg?{$version}"/>
                    <p>
                        <span>
                            <b id="username">xxx</b>
                        </span>
                        <span>{:__('等级')}：<span id="level_txt"></span></span>
                        <span>{:__('信用分')}：<span id="integral">0</span></span>
                        <span id="user_phone"></span>
                        <span id="user_email"></span>
                        <a style="display: none;" id="to_comment">({:__('评价')})</a>
                    </p>
                </div>
                <div class="is_demand"><span id="mission_total">{:__('发布次数')}：</span></div>
            </dl>
            <dl>
                <h6>{:__('客服')}</h6>
                <div>
                    <img src="{$osslink}static/index/image/index/LOGO-2.png?{$version}">
                    <p>
                        <span><b>{:__('网站客服')}</b></span>
                        <span>{:__('email')}：<span id="email"></span></span>
                        <span>{:__('电话号码')}：<span id="tel"></span></span>
                    </p>
                </div>
                <div><a>{:__('客服仅限雇主咨询，写手恶意骚扰封号处理')}</a></div>
            </dl>
        </ul>
    </div>
    <div class="layui-tab">
        <ul class="layui-tab-title task_tab">
          <li class="layui-this" data-target="1">{:__('任务作品')}</li>
          <li data-target="2">{:__('查看作品')}</li>
          <li data-target="3">{:__('评论')}</li>
        </ul>
        <div class="layui-tab-content task_content">
            <div class="layui-tab-item layui-show content" id="content">
                <div class='down_attach'><a download="" href="" >{:__('附件下载')}<i class="fa fa-arrow-down" aria-hidden="true"></i></a></div>
            </div>
            <div class="layui-tab-item contributeList" style="display: none;" id="contributeList"></div>
            <div class="layui-tab-item contribute_comment" id="contribute_comment"></div>
        </div>
    </div>
    <div id="in_page"></div>

    <div class="layui-tab join_write">
        <ul class="layui-tab-title">
          <li class="layui-this" data-target="1">{:__('已参与的写手')}</li>
          <span class="li_span">（{:__('已有')}<span id="user_count"></span>{:__('人报名')}）</span>
        </ul>
        <div class="layui-tab-content">
          <div class="layui-tab-item layui-show join_info">
              
          </div>
        </div>
    </div>
    <div class="layui-tab help_tab">
        <ul class="layui-tab-title">
          <li class="layui-this" data-target="1">{:__('会员常见问题')}</li>
        </ul>
        <div class="layui-tab-content">
          <div class="layui-tab-item layui-show helpinfo" id="helpinfo">
              
          </div>
        </div>
    </div>

    {include file="public/foot"}
    </div>
    {include file="public/right"}
</div>
<!-- [if IE]
    <style>
       .contributeList ul .contribute_user img{
            padding: 4%;
            width: 92%;
            height: 92%;
        } 
    </style>
    <script>
        console.log("aaaa");
    </script>
[endif] -->
{include file="public/footer"}
<script>
    var nowpage = 1;
    var u_id = 0;
    var task_status = 0;

    var total = 0;

    var money_cfg = '';
    var user_data = "";//任务发布者数据

    $("#in_page").css("display","none");
    var id = "{$id}";
    if(id == "0" || id == '' || id == undefined){
        layer.msg("{:__('参数错误')}",{icon:2},function(){
            window.location.href="/";
        });
    } else {
        $(function(){
            $('html').scrollTop(0);
            $.ajax({
                url:'/api/mission/detail',
                type:'get',
                data:{id:id,token:token},
                success:function(ret){
                    if(ret.code != 1){
                        window.location.href="/404";
                        return false;
                    }
                    var userData = getLocalStorage('userData');
                    var userdata = JSON.parse(userData);
                    var data = ret['data'];
                    u_id = data['u_id'];
                    task_status = data['status'];
                    if(data['title'] != undefined && data['title'] != null){
                        $("#title").append(data['title']);
                    }
                    if(data['money'] != undefined && data['money'] != null){
                        $(".task_money").append(data['money']);
                    } else {
                        $(".task_money").append(0);
                    }
                    $(".task_detail_tip .task_money").addClass("_important");
                    if(data['mission_no'] != undefined && data['mission_no'] != null){
                        $("#mission_no").append(data['mission_no']);
                    }
                    if(data['create_time'] != undefined && data['create_time'] != null){
                        $("#create_time").append(data['create_time']);
                    }
                    if(data['end_time'] != undefined && data['end_time'] != null){
                        $(".end_time").append(data['end_time']);
                        $(".task_detail_tip .end_time").addClass("_important");
                    }
                    if(data['status'] != undefined && data['status'] != null && data['status'] != 4 && data['status'] != 5){
                        if(data['left_time'] == '0' && data['left_time'] != 4 && data['left_time'] != 5){
                            $("#left_time").html("{:__('选稿中')}");
                        } else {
                            $("#left_time").html(data['left_time']);
                        }
                    } else {
                        $("#left_time").parent().remove();
                    }
                    // if(data['status'] == 1){
                    //     $("#status").html("{:__('待付款')}");
                    // } else if(data['status'] == 2){
                    //     $("#status").html("{:__('待审核')}");
                    // } else if(data['status'] == 3){
                    //     $("#status").html("{:__('进行中')}");
                    // } else if(data['status'] == 4){
                    //     $("#status").html("{:__('完成')}");
                    // } else if(data['status'] == 5){
                    //     $("#status").html("{:__('仲裁')}");
                    // }
                    $("#status").html(data['status_text']);
                    if(data['status'] != 3){
                        $(".task_btn_12").remove();
                    } else {
                        $(".task_btn_12").css("display","flex");
                    }
                    if(data['status'] == 3 && data['left_time'] != 0){
                        $("#sign_task").css("display","block");
                        $("#send_task").css("display","block");
                        if(data['sign_able'] == 1){
                            $("#sign_task").html("{:__('任务报名')}");
                            $("#send_task").remove();
                        } else {
                            
                            $("#sign_task").attr('disabled',true);
                            $("#sign_task").removeClass("layui-btn-primary");
                            $("#sign_task").addClass("layui-btn-disabled");
                            $("#sign_task").html("{:__('任务已报名')}");
                        }
                        if(data['sign_able'] != 1 && data['contribute_able'] == 1){
                            $("#send_task").html("{:__('任务交稿')}");
                        } else {
                            $("#send_task").attr('disabled',true);
                            $("#send_task").removeClass("layui-btn-primary");
                            $("#send_task").addClass("layui-btn-disabled");
                            $("#send_task").html("{:__('任务已交稿')}");
                        }
                    } else {
                        $(".task_btn_3").remove();
                    }
                    if(data['estimate_demand_able'] == 1 && userdata['u_id'] != u_id){
                        $("#to_comment").css("display","inline");
                    }
                    if(data['userInfo']['username'] != null && data['userInfo']['username'] != undefined){
                        $("#username").html(data['userInfo']['username']);
                    }
                    if(data['current_signed']>0 || (userdata != '' && userdata != null && userdata != undefined && userdata['u_id'] != '' && userdata['u_id'] != null && userdata['u_id'] != undefined && userdata['u_id'] == u_id) ){
                        if(data['userInfo']['email'] != null && data['userInfo']['email'] != undefined){
                            $("#user_email").html("<span>{:__('邮箱')}："+data['userInfo']['email']+"</span>");
                        }
                        if(data['userInfo']['phone'] != null && data['userInfo']['phone'] != undefined){
                            $("#user_phone").html("<span>{:__('联系电话')}："+data['userInfo']['phone']+"</span>");
                        }
                        
                    }
                    if(data['current_signed']>0){
                        $("#comment_task").css("display","inline-block");
                    }
                    
                    user_data = data;

                    if(data['mission_total'] != null && data['mission_total'] != undefined){
                        $("#mission_total").append(data['mission_total']);
                    }
                    if(data['mission_total'] != null && data['mission_total'] != undefined){
                        $("#content").prepend(data['content']);
                    }
                    if(data['file_path'] != null && data['file_path'] != undefined && data['file_path'] != ''){
                        $(".down_attach a").attr("href",data['file_path']);
                        $(".down_attach a").attr("download",data['file_name']);
                    } else {
                        $(".down_attach").remove();
                    }
                    var user_count = data['contribute']['users'].length;
                    $("#user_count").html(user_count);
                    var join_infohtl = "";
                    for(i in data['contribute']['users']){
                        if(data['contribute']['users'][i]['avatar'] == '' || data['contribute']['users'][i]['avatar'] == null || data['contribute']['users'][i]['avatar'] == undefined){
                            data['contribute']['users'][i]['avatar'] = '{$osslink}static/index/image/index/avgdefaultsmall.jpg?{$version}';
                        }
                        join_infohtl += "<li>";
                        join_infohtl += '<img id="user_'+data['contribute']['users'][i]['u_id']+'" src="{$osslink}static/index/image/index/avgdefaultsmall.jpg?{$version}" />';
                        join_infohtl += '<span style="line-height: 25px;">'+data['contribute']['users'][i]['username']+'</span>';
                        join_infohtl += "</li>";
                    }
                    for(j in data['contribute']['users']){
                        imgLoaing(data['contribute']['users'][j]['avatar'],{id:data['contribute']['users'][j]['u_id']});
                    }
                    $(".join_info").html(join_infohtl);
                    if(data['contribute'] != null && data['contribute'] != undefined && data['contribute'] != ''){
                        if(data['contribute']['all'] != null && data['contribute']['all'] != undefined){
                            $(".contribute_all").html("<span class='_important'>"+data['contribute']['all']+"</span>");
                        } else {
                            $(".contribute_all").html("<span class='_important'>0</span>");
                        }
                        if(data['contribute']['win'] != null && data['contribute']['win'] != undefined){
                            $(".contribute_win").html("<span class='_important'>"+data['contribute']['win']+"</span>");
                        } else {
                            $(".contribute_win").html("<span class='_important'>0</span>");
                        }
                    }
                    if(data['money_cfg'] == '' || data['money_cfg'] == null || data['money_cfg'] == undefined){
                        money_cfg = data['money_cfg'];
                    }
                    if(data['money_cfg'] == '' || data['money_cfg'] == null || data['money_cfg'] == undefined || data['money_cfg']['slt_bid_mode'] == 1){
                        $(".money_cfg_2").remove();
                        $(".money_cfg_3").remove();
                    }
                    if(data['money_cfg']['slt_bid_mode'] == 2){
                        $(".money_cfg_1").remove();
                        $(".money_cfg_3").remove();
                    }
                    if(data['money_cfg']['slt_bid_mode'] == 3){
                        $(".money_cfg_1").remove();
                        $(".money_cfg_2").remove();
                    }
                    $(".task_detail_tip").css("display","flex");
                    $(".task_detail_tip_hidden").css("display","none");

                    if(data['money_cfg']['gj_num'] != '' && data['money_cfg']['gj_num'] != null && data['money_cfg']['gj_num'] != undefined){
                        $(".gj_num").html("<span class='_important'>"+data['money_cfg']['gj_num']+"</span>");
                    }
                    if(data['money_cfg']['gj_money'] != '' && data['money_cfg']['gj_money'] != null && data['money_cfg']['gj_money'] != undefined){
                        $(".gj_money").html("<span class='_important'>"+data['money_cfg']['gj_money']+"</span>");
                    }
                    if(data['money_cfg']['txt_pople_1'] != 0 && data['money_cfg']['txt_pople_1'] != '' && data['money_cfg']['txt_pople_1'] != null){
                        $("#txt_pople_1").html("<span class='_important'>"+data['money_cfg']['txt_pople_1']+"</span>");
                        $("#txt_avg_money_1").html("<span class='_important'>"+data['money_cfg']['txt_avg_money_1']+"</span>");
                    } else {
                        $(".task_1").remove();
                    }
                    if(data['money_cfg']['txt_pople_2'] != 0 && data['money_cfg']['txt_pople_2'] != '' && data['money_cfg']['txt_pople_2'] != null){
                        $("#txt_pople_2").html("<span class='_important'>"+data['money_cfg']['txt_pople_2']+"</span>");
                        $("#txt_avg_money_2").html("<span class='_important'>"+data['money_cfg']['txt_avg_money_2']+"</span>");
                    } else {
                        $(".task_2").remove();
                    }
                    if(data['money_cfg']['txt_pople_3'] != 0 && data['money_cfg']['txt_pople_3'] != '' && data['money_cfg']['txt_pople_3'] != null){
                        $("#txt_pople_3").html("<span class='_important'>"+data['money_cfg']['txt_pople_3']+"</span>");
                        $("#txt_avg_money_3").html("<span class='_important'>"+data['money_cfg']['txt_avg_money_3']+"</span>");
                    } else {
                        $(".task_3").remove();
                    }

                    if(data['userInfo']['profile'] != '' && data['userInfo']['profile'] != null && data['userInfo']['profile'] != undefined 
                    && data['userInfo']['profile']['avatar'] != '' && data['userInfo']['profile']['avatar'] != null && data['userInfo']['profile']['avatar'] != undefined ){
                        $("#avatar").attr("src",data['userInfo']['profile']['avatar']);
                    } else {
                        $("#avatar").attr("src",'{$osslink}static/index/image/index/avgdefaultsmall.jpg?{$version}');
                    }
                    
                    if(data['userInfo'] != '' && data['userInfo'] != null && data['userInfo'] != undefined && data['userInfo']['credit'] != '' 
                    && data['userInfo']['credit'] != null && data['userInfo']['credit'] != undefined){
                        var credit = data['userInfo']['credit'];
                    } else {
                        var credit = {'integral':0,'level':0,'level_txt':'{:__("新晋")}'}
                    }
                    
                    if(credit['level_txt'] != '' && credit['level_txt'] != null && credit['level_txt'] != undefined){
                        level_txt = credit['level_txt'];
                    } else {
                        // $("#level_txt").html('{:__("新晋")}');
                        level_txt = '{:__("新晋")}';
                    }
                    if(credit['integral'] != '' && credit['integral'] != null && credit['integral'] != undefined){
                        $("#integral").html(credit['integral']);
                    } else {
                        $("#integral").html(0);
                    }
                    
                    if(credit['level'] != '' && credit['level'] != null && credit['level'] != undefined){
                        level_txt += levelObj[credit['level']];
                    } else {
                        level_txt += levelObj[1];
                    }
                    $("#level_txt").html(level_txt);

                    if(userdata == '' || userdata == null || userdata == undefined){
                        $(".task_btn_12").remove();
                        $(".task_btn_3").remove();
                    } else {
                        if(userdata['u_id'] == u_id){
                            $(".task_btn_3").remove();
                        }
                        if(userdata['u_id'] != u_id){
                            $(".task_btn_12").remove();
                        }
                    }

                    if(data['money_cfg'] != null && data['money_cfg'] != undefined && data['money_cfg'] != ''){
                        money_cfg = data['money_cfg'];
                    }

                }
            });

        });
        
    }

    var userData = getLocalStorage('userData');
    var userdata = JSON.parse(userData);
    

    var mission_config = getLocalStorage("mission_config");
    mission_configObj = JSON.parse(mission_config);
    if(mission_configObj != null && 
    mission_configObj['mission_config'] != null &&
    mission_configObj['mission_config'] != undefined &&
    mission_configObj['mission_config']['service'] != null &&
    mission_configObj['mission_config']['service'] != undefined &&
    mission_configObj['mission_config']['service']['phone'] != null &&
    mission_configObj['mission_config']['service']['phone'] != undefined &&
    mission_configObj['mission_config']['service']['email'] != null &&
    mission_configObj['mission_config']['service']['email'] != undefined){
        $("#tel").html(mission_configObj['service']['phone']);
        $("#email").html(mission_configObj['service']['email']);
    } else {
        objs = {
            'mission_config':1
        };
        CacheLoad(objs);
        $(document).queue("mission_config,",function(){
            var mission_config = getLocalStorage("mission_config");
            mission_configObj = JSON.parse(mission_config);
            $("#tel").html(mission_configObj['service']['phone']);
            $("#email").html(mission_configObj['service']['email']);
        });
    }
    $("#sign_task").click(function(){
        layer.confirm("{:__('是否确认报名')}?",{title:"{:__('提示')}",btn:['{:__("确定")}','{:__("取消")}']},function(){
            $.ajax({
                url:"/api/mission/sign",
                type:'post',
                data:{token:token,mission_id:id},
                success:function(ret){
                    if(ret.code == 1){
                        layer.msg(ret.msg,{icon:1},function(){
                            // window.location.reload();
                            $("#sign_task").attr('disabled',true);
                            $("#sign_task").removeClass("layui-btn-primary");
                            $("#sign_task").addClass("layui-btn-disabled");
                            $("#sign_task").html("{:__('任务已报名')}");

                            $("#comment_task").css("display","block");
                            var btnhtm = '<button id="send_task" class="layui-btn layui-btn-primary">{:__("任务交稿")}</button>';
                            $("#sign_task").after(btnhtm);
                            
                            var join_infohtl = '';
                            if(userdata != '' && userdata != null && userdata != undefined){
                                join_infohtl += "<li>";
                                join_infohtl += '<img id="user_'+userdata['u_id']+'" src="{$osslink}static/index/image/index/avgdefaultsmall.jpg?{$version}" onerror="changeimg(this)"/>';
                                join_infohtl += '<span style="line-height: 25px;">'+userdata['username']+'</span>';
                                join_infohtl += "</li>";
                            }
                            imgLoaing(userdata['profile']['avatar'],{id:userdata['u_id']});
                            $(".join_info").append(join_infohtl);
                        });
                    } else if(ret.code !=401){
                        layer.msg(ret.msg,{icon:2});
                    }
                }
            });
        });
        
    });
    var status = '';
    function getcontribute(page){
        $.ajax({
            url:'/api/mission/contributeList',
            type:"get",
            data:{mission_id:id,page:page,limit:10,status:status,token:token},
            success:function(ret){
                htl = "<ul class='contribute_status'>"+
                    "<button data-target='' class='layui-btn layui-btn-primary'>{:__('所有稿件')}</button>"+
                    "<button data-target='3' class='layui-btn layui-btn-primary'>{:__('合格')}</button>"+
                    "<button data-target='2' class='layui-btn layui-btn-primary'>{:__('采纳')}</button></ul>";
                data = ret['data']['ls'];
                for(i in data){
                    var willtag = "";
                    var pass = "";
                    
                    if(userdata == '' || userdata == null || userdata == undefined){
                        willtag = '';
                    } else if(data[i]['status'] == 1 && userdata['u_id'] == u_id && task_status == "3"){
                        willtag = '<button data-target="'+data[i]['id']+'" id="adopt" class="layui-btn layui-btn-primary">{:__("采纳")}</button>';
                    } else if(data[i]['status'] == 2 && userdata['u_id'] == u_id && task_status == "3"){
                        willtag = '<button data-target="'+data[i]['id']+'" id="markqualified" class="layui-btn layui-btn-primary">{:__("合格")}</button>';
                    }
                    var uiddata = getLocalStorage("userData");
                    var uidjson = JSON.parse(uiddata);
                    if(uidjson == '' || uidjson == undefined || uidjson == null){
                        var uid = 0;
                    } else {
                        var uid = uidjson['u_id'];
                    }
                    // if(u_id == uid){
                    //     willtag += "<button  data-target='"+data[i]['u_id']+"' class='comment_contribution layui-btn layui-btn-primary'>{:__('评论')}</button>";
                    // }
                    if(data[i]['status'] == 2){
                        pass = '<div class="adopt">{:__("已采纳")}</div>';
                    }
                    if(data[i]['status'] == 3){
                        pass = '<div class="pass">{:__("合格")}</div>';
                    }
                    if(data[i]['status'] == 3 && money_cfg['slt_bid_mode'] == 2){
                        pass = '<div class="pass">{:__("合格")}('+data[i]['prize_level']+'{:__("等奖")})</div>';
                    }
                    if(data[i]['user_info']['profile'] == '' || data[i]['user_info']['profile'] == null || data[i]['user_info']['profile'] == undefined){
                        data[i]['user_info']['profile'] = '';
                        data[i]['user_info']['profile']['avatar'] = '';
                    }
                    var view_able = '';
                    if(userdata != '' && userdata != null && userdata != undefined){
                        if(parseInt(data[i]['view_able'])<100 && userdata['u_id'] != data[i]['user_info']['u_id']){
                            view_able = '<a class="read_tip">{:__("(免费)采纳后才能看完整稿件")}</a>'
                        }
                    } else {
                        if(parseInt(data[i]['view_able'])<100){
                            view_able = '<a class="read_tip">{:__("(免费)采纳后才能看完整稿件")}</a>'
                        }
                    }
                    attachhtl = "";
                    if(data[i]['file_path'] != '' && data[i]['file_path'] != null && data[i]['file_path'] != undefined){
                        // var fnamearr = data[i]['file_path'].split("/");
                        // var len = fnamearr.length;
                        var fname = data[i]['file_name'];
                        attachhtl += "<div class='contribute_attach'>{:__('附件')}：<a download='"+fname+"' href='"+data[i]['file_path']+"'>"+fname+"</a></div>";
                    }
                    
                    var emailauth = "";
                    if(data[i]['user_info']['user_authen'].indexOf(1) != -1){
                        emailauth = "<i class='layui-icon emailverity' style='color:rgb(122,194,253) !important'>&#xe618;</i>";
                    } else {
                        emailauth = "<i class='layui-icon emailverity' !important'>&#xe618;</i>";
                    }
                    if(data[i]['user_info']['username'] == null || data[i]['user_info']['username'] == undefined){
                        data[i]['user_info']['username'] = '';
                    }
                    var content_len = data[i]['content'].length;
                    if(content_len>1400){
                        content = "<span class='content_'>"+data[i]['content'].substr(0,1400)+"<span style='font-size:12px;line-height:30px;display: block;margin-left: 0px;'><a data-target='"+data[i]['id']+"'  class='_show'>查看全部<i style='font-size:12px;line-height:30px;margin-left:2px' class='layui-icon'>&#xe61a;</i></a></span></span>";
                    } else {
                        content = "<span class='content_'>"+data[i]['content']+"</span>";
                    }
                    if(u_id == uid && data[i]['star_level'] == 0){
                        reward_contribution = '<a data-target="'+data[i]['u_id']+'" class="reward_contribution" style="font-weight:400;color:red;margin-left:5px;">({:__("评价")})</a>';
                    } else {
                        reward_contribution = "";
                    }
                    if(data[i]['star_level'] != 0){
                        var star = '<i class="fa comment_star fa-star" aria-hidden="true" style="color: rgb(255, 194, 14);"></i>';
                        var starhtl = "";
                        var star_len = parseInt(data[i]['star_level']);
                        for(k=0;k<star_len;k++){
                            starhtl += star;
                        }
                        var comment_contribution = '<span>{:__("已评价")}：'+starhtl+'</span>';
                    } else {
                        var comment_contribution = '';
                    }
                    if(data[i] != '' && data[i] != null && data[i] != undefined && data[i]['user_info'] != '' && data[i]['user_info'] != null && data[i]['user_info'] != undefined && data[i]['user_info']['user_credit'] != '' 
                    && data[i]['user_info']['user_credit'] != null && data[i]['user_info']['user_credit'] != undefined){
                        var credit = data[i]['user_info']['user_credit'];
                    } else {
                        var credit = {'integral':0,'level':0,'level_txt':'{:__("新晋")}'}
                    }
                    if(credit['level_txt'] != '' && credit['level_txt'] != null && credit['level_txt'] != undefined){
                        var level_txt = credit['level_txt'];
                    } else {
                        var level_txt = '{:__("新晋")}';
                    }
                    if(credit['integral'] != '' && credit['integral'] != null && credit['integral'] != undefined){
                        var integral = credit['integral'];
                    } else {
                        var integral = 0;
                    }

                    htl += '<ul>'+
                    '<dl class="contribute_user">'+
                        '<h6>{:__("稿件编号")}：'+data[i]['id']+'{:__("号")}'+reward_contribution+'</h6>'+
                        '<img src="'+data[i]['user_info']['profile']['avatar']+'" onerror="changeimg(this)"/>'+
                        '<span>{:__("用户名")}：'+data[i]['user_info']['username']+'</span>'+
                        '<span>{:__("认证状态")}：'+emailauth+'</span>'+
                        '<span>{:__("用户等级")}：'+level_txt+'</span>'+
                        '<span>{:__("用户信用分")}：'+integral+'</span>'+
                        '<span>{:__("中标次数")}：'+data[i]['user_info']['stat_contrbute_win']+'</span>'+
                        comment_contribution+
                        '</dl>'+
                        '<dl class="contribute_info">'+
                            '<h6>{:__("时间")}: '+data[i]['create_time']+'</h6>'+
                            pass+
                            '<div class="contribute_content">'+attachhtl+'<span>'+content+view_able+'</span>'+
                            '</div>'+
                            '<div class="contribute_btn">'+willtag+'</div>'+
                        //    '<div class="extent_coment">'+
                        //    '<a data-target="'+data[i]['id']+'" class="show_comtent">{:__("查看评论")}<i class="layui-icon">&#xe61a;</i></a>'+
                        //    '<div class="comtent_detail"></div>'+
                        //    '</div>'+
                        '</dl>'+
                    '</ul>';
                }
                $("#contributeList").html(htl);

                total = ret['data']['total'];
                if(page == 1){
                    getpage();
                }
                
            }
        });
    }
    $(document).on("click","._show",function(){
        var _this = $(this);
        var id = _this.attr("data-target");
        $.ajax({
            url:"/api/mission/contributeDetail",
            type:"get",
            data:{id:id,token:token},
            success:function(ret){
                if(ret != null && ret != undefined && ret != '' 
                && ret['data'] != null && ret['data'] != undefined && ret['data'] != '' 
                && ret['data']['content'] != null && ret['data']['content'] != undefined && ret['data']['content'] != ''){
                    _this.parents(".content_").html(ret['data']['content']);
                } else {
                    layer.msg("{:__('获取全部稿件失败')}",{icon:2});
                }
            }
        })
    });
    // $(document).on("click",".show_comtent",function(){
    //     var _this = $(this);
    //     var id = _this.attr("data-target");
    //     var html = "";
    //     var content = _this.siblings(".comtent_detail").html();
    //     if(content == ""){
    //         var reward_html = "<div class='comment_reward'><a>{:__('回复')}</a></div>";
    //         html += "<div class='_detail'><div class='comment_img'>"+
    //         "<img src='https://rd-reward.oss-us-west-1.aliyuncs.com/image/2022-02-18/1645173428_1.png'>"+
    //         "</div>"+
    //         "<div class='comment_pubish'>"+
    //         "<div class='comment_time'><a style='margin-right:10px;color:black;font-size:15px'>n_b</a>2010-12-23</div>"+
    //         "<div class='comment_content'>哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈</div>"+
    //         "</div>"+reward_html+
    //         "</div>";
    //     }
    //     _this.siblings(".comtent_detail").html(html);
    // });
    $(document).on("click",".contribute_status button",function(){
        status = $(this).attr("data-target");
        getcontribute(1);
        //分页
    });

    $(".task_tab li").click(function(){
        var tab = $(this).attr("data-target");
        if(tab == 1){
            $("#contributeList").css('display',"none");
            $("#in_page").css("display","none");
        } else if(tab == 2) {
            $("#contributeList").css('display',"block");
            getcontribute(1);
            $("#in_page").css("display","block");
        } else if(tab == 3){
            $("#contributeList").css('display',"none");
            getcoment(1);
            $("#in_page").css("display","block");
        }
        status = '';
    });
    function getcoment(page){

        $.ajax({
            url:'/api/mission/comments',
            type:'get',
            data:{page:page,limit:10,mission_id:id},
            success:function(ret){
                if(ret == null || ret == '' || ret == undefined){
                    layer.msg("{:__('获取数据失败')}",{icon:2});
                    return false;
                }
                if(ret.code != 1){
                    layer.msg(ret.msg,{icon:2});
                    return false;
                }
                if(ret['data'] == null || ret['data'] == '' || ret['data'] == undefined){
                    layer.msg("{:__('获取数据失败')}",{icon:2});
                    return false;
                }
                if(ret['data']['ls'] == null || ret['data']['ls'] == '' || ret['data']['ls'] == undefined){
                    return false;
                }
                var data = ret['data']['ls'];
                var html = "<div class='comtent_detail'>";
                for(i in data){
                    var userdata = getLocalStorage("userData");
                    var userjson = JSON.parse(userdata);
                    var uid = userjson['u_id'];
                    if(u_id == uid){
                        var reward = "<a data-target='"+data[i]['id']+"' class='comment_reward'>{:__('回复')}</a>";
                    } else {
                        reward = "";
                    }
                    
                    var reward_html = "<div>"+reward+"<a data-target='"+data[i]['id']+"' class='comment_all'>{:__('显示回复')}</a></div>";
                    html += "<div class='_detail'><div class='comment_img'>"+
                        "<img src='"+data[i]['avatar']+"' onerror='changeimg(this)'>"+
                        "</div>"+
                        "<div class='comment_pubish'>"+
                        "<div class='comment_time'><a style='margin-right:10px;color:black;font-size:15px'>"+data[i]['username']+"</a>"+data[i]['create_time']+"</div>"+
                        "<div class='comment_content'>"+data[i]['content']+"</div>"+
                        "</div>"+
                        reward_html+
                        "</div>";
                    if(data[i]['replys'] != '' && data[i]['replys'] != null && data[i]['replys'] != undefined){
                        for(j in data[i]['replys']){
                            var time = data[i]['replys'][j]['create_time'];
                            var create_time = getDate(time);
                            html += "<div style='margin-left:30px;display:none' class='_detail show_reply_"+data[i]['id']+"'><div class='comment_img'>"+
                            "<img src='"+data[i]['replys'][j]['avatar']+"'>"+
                            "</div>"+
                            "<div class='comment_pubish'>"+
                            "<div class='comment_time'><a style='margin-right:10px;color:black;font-size:15px'>"+data[i]['replys'][j]['username']+"</a>"+create_time+"</div>"+
                            "<div class='comment_content'>"+data[i]['replys'][j]['content']+"</div>"+
                            "</div>"+
                            "</div>";
                        }
                    }
                    html += "<hr></hr>";
                }
                html+= '</div>';
                $("#contribute_comment").html(html);
                total = ret['data']['total'];
                if(page == 1){
                    getpage();
                }
            }
        });
    }
    $(document).on("click",".comment_all",function(){
        var _this = $(this);
        var id = _this.attr("data-target");
        var len = $(".show_reply_"+id).length;
        if(len == 0){
            layer.msg("{:__('暂无回复')}",{icon:3});
            return false;
        }
        if($(".show_reply_"+id).eq(0).css("display") == 'none'){
            $(".show_reply_"+id).css("display","flex");
            _this.html("{:__('收起回复')}");
        } else {
            $(".show_reply_"+id).css("display","none");
            _this.html("{:__('显示回复')}");
        }
        
    });
    function getpage(){
        createpage('in_page',total,10,function(obj,first){
            nowpage = obj.curr;
            var tab = $(".task_tab li.layui-this").attr("data-target");
            if(tab == 2 && !first){
                getcontribute(nowpage);
            } else if(tab == 3 && !first){
                getcoment(nowpage);
            }
        });
    }

    $.ajax({
        url:'/api/info/index',
        type:'get',
        data:{page:1,limit:8},
        success:function(ret){
            var htl = '<ul>';
            if(ret['data'] == null || ret['data'] == '' || ret['data'] == undefined){
                return false;
            }
            if(ret['data']['ls'] == null || ret['data']['ls'] == '' || ret['data']['ls'] == undefined){
                return false;
            }
            for(i in ret['data']['ls']){
                htl += '<li><a href="/'+ret['data']['ls'][i]['route']+'">'+ret['data']['ls'][i]['title']+'</a></li>';
            }
            htl += '</ul>';
            $("#helpinfo").html(htl);
        }
    });
    $(document).on('click',"#send_task",function(){
        path = window.location.pathname;
        window.location.href="/index/Task/sendtask?taskid="+id+"&path="+path;
    });
    $(document).on('click',"#adopt",function(){
        var _this = $(this);
        var id = _this.attr("data-target");
        layer.confirm("{:__('是否点击确定采纳')}？",{title:"{:__('提示')}",btn:['{:__("确定")}','{:__("取消")}']},function(){
            $.ajax({
                url:'/api/mission/adopt',
                type:'post',
                data:{token:token,id:id},
                success:function(ret){
                    if(ret['code'] == 1){
                        layer.msg(ret['msg'],{icon:1},function(){
                            getcontribute(1);
                        });
                    } else if(ret['code'] != 401){
                        layer.msg(ret['msg'],{icon:2});
                    }
                }
            });
        });
    });
    $(document).on("click","#markqualified",function(){
        var _this = $(this);
        var id = _this.attr("data-target");
        layer.confirm("{:__('是否点击确定合格')}？",{title:"{:__('提示')}",btn:['{:__("确定")}','{:__("取消")}']},function(){

            if(money_cfg['slt_bid_mode'] != '' && money_cfg['slt_bid_mode'] != null && money_cfg['slt_bid_mode'] != undefined
            && (money_cfg['slt_bid_mode'] == 1 || money_cfg['slt_bid_mode'] == 3) ){
                $.ajax({
                    url:'/api/mission/markqualified',
                    type:'post',
                    data:{token:token,id:id},
                    success:function(ret){
                        if(ret['code'] == 1){
                            layer.msg(ret['msg'],{icon:1},function(){
                                getcontribute(1);
                            });
                        } else if(ret['code'] != 401){
                            layer.msg(ret['msg'],{icon:2});
                        }
                    }
                });
            } else {
                layer.closeAll();
                var optionhtm = "";
                if( money_cfg['txt_pople_3'] != '' && money_cfg['txt_pople_3'] != null 
                && money_cfg['txt_pople_3'] != undefined){
                    optionhtm = "<option value='1'>{:__('一等奖')}</option>"+
                        "<option value='2'>{:__('二等奖')}</option>"+
                        "<option value='3'>{:__('三等奖')}</option>";
                } else if( money_cfg['txt_pople_2'] != '' && money_cfg['txt_pople_2'] != null 
                && money_cfg['txt_pople_2'] != undefined){
                    optionhtm = "<option value='1'>{:__('一等奖')}</option>"+
                        "<option value='2'>{:__('二等奖')}</option>";
                } else {
                    optionhtm = "<option value='1'>{:__('一等奖')}</option>";
                }
                
                var index = layer.open({
                    type:1,
                    title:'{:__("奖项设置")}',
                    content:"<div class='prize_level_out'><p>{:__('奖项等级')}：<i style='position:absolute;right:10%' class='fa fa-angle-down' aria-hidden='true'></i><select id='prize_level' class='layui-input' type='text'/>"+
                        optionhtm+
                        "</select></p><p><button data-target='"+id+"' id='prize_level_btn' class='layui-btn layui-btn-primary'>{:__('确认')}</button></p></div>",
                    area:['300px','150px']
                });
                layer.style(index, {
                    top: '150px'
                });
            }

        });
    });
    $(document).on("click","#prize_level_btn",function(){
        var id = $(this).attr("data-target");
        var prize_level = $("#prize_level").val();
        prize_levelint = parseInt(prize_level);
        if(prize_levelint!=1 && prize_levelint!=2 && prize_levelint!=3){
            layer.msg("{:__('获奖等级只能是一二三级')}",{icon:3});
            return false;
        }
        $.ajax({
            url:'/api/mission/markqualified',
            type:'post',
            data:{token:token,id:id,prize_level:prize_level},
            success:function(ret){
                if(ret['code'] == 1){
                    layer.msg(ret['msg'],{icon:1},function(){
                        // window.location.reload();
                        getcontribute(nowpage);
                        layer.closeAll();
                    });
                } else if(ret['code'] != 401){
                    layer.msg(ret['msg'],{icon:2});
                }
            }
        });
    });
    $("#complete").click(function(){
        $.ajax({
            url:'/api/mission/complete',
            type:'post',
            data:{token:token,id:id},
            success:function(ret){
                if(ret['code'] == 1){
                    layer.msg(ret['msg'],{icon:1},function(){
                        window.location.reload();
                    });
                } else if(ret['code'] != 401){
                    layer.msg(ret['msg'],{icon:2});
                }
            }
        });
    });
    //写手对任务评论
    $(document).on("click","#comment_task",function(){
        var _this = $(this);
        layer.open({
            btn:["{:__('提交')}"],
            area:['500px','320px'],
            type: 1,
            title:'{:__("评论")}',
            content:$("#comment"),
            yes:function(e){
                var content = $("#comment textarea").val();
                _comment(content,0,_this);
            }
        })
    });
    //雇主对写手评论
    // $(document).on("click",".comment_contribution",function(){
    //     var id = $(this).attr("data-target")
    //     layer.open({
    //         btn:["{:__('提交')}"],
    //         area:['500px','320px'],
    //         type: 1,
    //         title:'{:__("评论")}',
    //         content:$("#contribution_comment"),
    //         yes:function(e){
                
    //         }
    //     })
    // });
    //雇主回复写手评论
    $(document).on("click",".comment_reward",function(){
        var _this = $(this);
        var reply_id = _this.attr("data-target");
        layer.open({
            btn:["{:__('提交')}"],
            area:['500px','320px'],
            type: 1,
            title:'{:__("评论")}',
            content:$("#contribution_comment"),
            yes:function(e){
                var content = $("#contribution_comment textarea").val();
                _comment(content,reply_id,_this);
            }
        })
    });

    function _comment(content,reply_id,_this){
        if(content.replaceAll(" ","") == ""){
            layer.msg("{:__('评论不能为空')}",{icon:2});
            return false;
        }
        var outhtml = $(".layui-layer-btn0")[0].outerHTML;
        $(".layui-layer-btn0").remove();
        $.ajax({
            url:"/api/mission/addComment",
            type:"post",
            data:{mission_id:id,content:content,token:token,reply_id:reply_id},
            success:function(ret){
                if(reply_id >0 && ret.code == 1){
                    var userData = getLocalStorage('userData');
                    var userdata = JSON.parse(userData);
                    html = "<div style='margin-left:30px;' class='_detail show_reply_"+reply_id+"'><div class='comment_img'>"+
                            "<img src='"+userdata['profile']['avatar']+"'>"+
                            "</div>"+
                            "<div class='comment_pubish'>"+
                            "<div class='comment_time'><a style='margin-right:10px;color:black;font-size:15px'>"+userdata['username']+"</a>"+getDate("")+"</div>"+
                            "<div class='comment_content'>"+content+"</div>"+
                            "</div>"+
                            "</div>";
                    $(".show_reply_"+reply_id).css("display","flex");
                    _this.parent().parent().after(html);
                    layer.msg("{:__('评论成功')}",{icon:1},function(){
                        $("#comment textarea").val("");
                        $("#contribution_comment textarea").val("");
                        layer.closeAll();
                    });
                    return false;
                }
                if(ret.code == 1){
                    $('.task_tab li[data-target=3]').trigger("click");
                    layer.msg("{:__('评论成功')}",{icon:1},function(){
                        $("#comment textarea").val("");
                        $("#contribution_comment textarea").val("");
                        layer.closeAll();
                    });
                } else if(ret.code != 401) {
                    layer.msg(ret.msg,{icon:2},function(){
                        $(".layui-layer-btn-").html(outhtml);
                    });
                }
            }
        });
    }
    $("#to_comment").click(function(){
        var _this = $(this);
        layer.open({
            btn:["{:__('提交')}"],
            area:['300px','150px'],
            type: 1,
            title:'{:__("评价")}',
            content:$("#to_comment_star"),
            yes:function(e){
                var score = $("#to_comment_star input").val();
                $.ajax({
                    url:'/api/mission/estimateByService',
                    type:'post',
                    data:{mission_id:id,token:token,score:score},
                    success:function(ret){
                        if(ret.code == 1){
                            layer.msg(ret.msg,{icon:1},function(){
                                layer.closeAll();
                                $("#to_comment").remove();
                            });
                        } else if(ret.code != 401) {
                            layer.msg(ret.msg,{icon:2});
                        }
                    }
                });
            }
        })
    });
    $(document).on("click",".reward_contribution",function(){
        var _this = $(this);
        var u_id = _this.attr("data-target");
        layer.open({
            btn:["{:__('提交')}"],
            area:['300px','150px'],
            type: 1,
            title:'{:__("评价")}',
            content:$("#to_comment_star"),
            yes:function(e){
                var score = $("#to_comment_star input").val();
                $.ajax({
                    url:'/api/mission/estimateByDemander',
                    type:'post',
                    data:{mission_id:id,token:token,score:score,to_uid:u_id},
                    success:function(ret){
                        if(ret.code == 1){
                            layer.msg(ret.msg,{icon:1},function(){
                                var star = '<i class="fa comment_star fa-star" aria-hidden="true" style="color: rgb(255, 194, 14);"></i>';
                                var starhtl = "";
                                var star_len = parseInt(score);
                                for(k=0;k<star_len;k++){
                                    starhtl += star;
                                }
                                var comment_contribution = '<span>{:__("已评价")}：'+starhtl+'</span>';
                                _this.parents().parents(".contribute_user").append(comment_contribution);
                                _this.remove();
                                layer.closeAll();
                            });
                        } else if(ret.code != 401) {
                            layer.msg(ret.msg,{icon:2});
                        }
                    }
                });
            }
        });
    });
    $(document).on("mouseenter","#to_comment_star i",function(){
        var _this = $(this);
        var len = _this.attr("data-target");
        $("#to_comment_star input").val(len);
        $("#to_comment_star i").removeClass("fa-star");
        $("#to_comment_star i").addClass("fa-star-o");
        for(i=1;i<=len;i++){
            $("#to_comment_star i[data-target="+i+"]").removeClass("fa-star-o");
            $("#to_comment_star i[data-target="+i+"]").addClass("fa-star");
            $(".fa-star").css("color","#ffc20e");
            $(".fa-star-o").css("color","#333333");
        }
    });
</script>
<div id="comment" style="text-align: right;display: none;">
    <textarea class="content_text"></textarea>
</div>
<div id="contribution_comment" style="text-align: right;display: none;">
    <textarea class="content_text"></textarea>
</div>
<div id="to_comment_star" style="text-align: center;display: none;line-height: 40px;font-size: 20px;font-weight: 100;">
    <i data-target="1" class="fa fa-star-o comment_star" aria-hidden="true"></i>
    <i data-target="2" class="fa fa-star-o comment_star" aria-hidden="true"></i>
    <i data-target="3" class="fa fa-star-o comment_star" aria-hidden="true"></i>
    <i data-target="4" class="fa fa-star-o comment_star" aria-hidden="true"></i>
    <i data-target="5" class="fa fa-star-o comment_star" aria-hidden="true"></i>
    <input style="display: none;"/>
</div>